package com.example.listener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 打印所有的事件，需要继承ApplicationListener
 */
@Component
public class PrintAllApplicationListener implements ApplicationListener<ApplicationEvent> {

  @Override
  public void onApplicationEvent(ApplicationEvent event) {
    System.out.println("PrintAllApplicationListener事件触发：" + event.getClass().getName());
  }
}
